<template>
  <div class="swiper">
    <Swiper :options="swiperOption">
      <Swiper-slide v-for="(item,index) in lists"
                    :key="index">
        <div class="one"
             @click="btnAction(index,item)">
          <img :src="url+item.image_url"
               alt="">
          <button class="channel_btn">{{item.title}}</button>
        </div>
      </Swiper-slide>
      <div class="swiper-pagination swiper-pagination-bullets"
           slot="pagination"></div>
    </Swiper>

  </div>
</template>
<script>

import { Swiper, SwiperSlide } from 'vue-awesome-swiper';
export default {
  name: "SwiperKind1",
  data: function () {
    return {
      lists: [],
       channel:[],
      url: "https://fuss10.elemecdn.com",
      swiperOption: {
       // loop: fla,
        slidesPerView: 4,
        slidesPerColumnFill: "row",
        slidesPerColumn: 2,
        slidesPerGroup: 4,
         pagination: {
          el: ".swiper-pagination",
        },
        // el: '.swiper-pagination',
        // type: 'bullets',

      },
      selectIndex: 0
    }
  },
  porps: ['lists'],
 
  components: {
    Swiper,
    SwiperSlide
  },
  created () {
    //console.log(1212)
    this.$axios.get("api1/v2/index_entry", {
    }).then(res => {
      //console.log(res);
      this.lists = res;
     // this.channel = res.title
     // console.log(res.title)
      //console.log(this.lists[0].image_url)
      //console.log(this.lists)
    }).catch(err => console.log(err));
  }
  ,
  methods: {
    btnAction (index) {
      this.$router.push({name:'Shop_B',params:{id:this.lists[index].title}});
     console.log(this.lists[index].title)
     
    }
  }
}
</script>
<style lang="less">
.swiper {
  font-size: 12px;
  color: black;
  height: 200px;
  background: white;
  padding-top: 10px;
  .one {
    text-align: center;
  }
  img {
    width: 50px;
  }
  .channel_btn {
    background-color: rgba(0, 0, 0, 0);
    padding: 5px 15px;
    border: 0;
    outline: none;
    font-size: 14px;
    color: #555;
    width: 100%;
  }
  .select {
    color: #aaff;
  }
}
.swiper-pagination{
  z-index: 20;
 position: absolute;
 bottom:-3px !important;
 
}
</style>